package com.demo.autotest.database.mapper;

import com.demo.autotest.database.domain.Role;
import com.demo.autotest.database.domain.RolePermission;
import com.demo.autotest.database.domain.User;
import com.demo.autotest.database.domain.UserRole;
import com.demo.autotest.dto.RoleDTO;
import com.demo.autotest.request.QueryRequest;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper   // 定义Dao层
public interface RoleMapper {

     void insertRole(Role role);

     void insertRolePermissions(List<RolePermission> rolePermissions);

     void deleteRoleUser(UserRole userRole);

     List<RoleDTO> getRoleList(QueryRequest request);

     List<User> getRoleUser(String roleId);

     Integer countRoleUser(String roleId, String userId);

     void insertRoleUser(List<UserRole> userRoles);

     Integer countRoleUserByProject(String projectId, String userId);

     Role getRoleById(String id);

}
